//
//  Director.swift
//  Car
//
//  Created by mac on 2017/10/30.
//  Copyright © 2017年 RRC. All rights reserved.
//

import Foundation

public class Director {
    
    private var sequence = Array<String>()
    
    private var benzBuilder = BenzBuilder()
    
    private var bmwBuilder = BMWBuilder()
    
    func getBenzModel() -> BenzModel {
        self.sequence.removeAll()
        self.sequence.append("start")
        self.sequence.append("stop")
        self.benzBuilder.setSequence(sequence: self.sequence)
        return self.benzBuilder.getCarMOdel() as! BenzModel
    }
    
    func getBMWModel() -> BMWModel {
        self.sequence.removeAll()
        self.sequence.append("alarm")
        self.sequence.append("start")
        self.sequence.append("stop")
        self.bmwBuilder.setSequence(sequence: self.sequence)
        return self.bmwBuilder.getCarMOdel() as! BMWModel
    }
    
}
